﻿namespace FFF.Test.Util
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Abp.Linq.Extensions;
    using Z.Expressions;

    /// <summary>
    /// 动态代码帮助类
    /// </summary>
    public static class EvalHelper
    {
        /// <summary>
        /// 初始化注册动态
        /// </summary>
        public static void InitRegister()
        {
            //  注册动态的代码的扩展方法
            EvalManager.DefaultContext.RegisterExtensionMethod(typeof(QueryableExtensions));
        }

        /// <summary>
        /// 动态注册类型
        /// </summary>
        /// <param name="type">注册类型</param>
        public static void InitRegisterType(Type type)
        {
            EvalManager.DefaultContext.RegisterType(type);
        }
    }
}
